package alpha;

import alpha.controllers.UserController;

import org.springframework.boot.SpringApplication;  
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;  
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.SpringBootServletInitializer;
import org.springframework.context.annotation.ComponentScan;  
import org.springframework.context.annotation.Configuration;  
  
/** 
 * <p>User: Dtj
 * <p>Date: 17-04-18 
 * <p>Version: 1.0 
 */  
@Configuration  
@ComponentScan  
@EnableAutoConfiguration
//@SpringBootApplication
public class Application extends SpringBootServletInitializer {
	 @Override
	    protected SpringApplicationBuilder configure(
	            SpringApplicationBuilder application) {
	        return application.sources(Application.class);
	    }
//public class Application {  
    public static void main(String[] args) {  
        SpringApplication.run(Application.class);  
        System. out .println( " 内存信息 :" + toMemoryInfo());
    }  
        public static String toMemoryInfo() {
           Runtime currRuntime = Runtime.getRuntime ();
           int nFreeMemory = ( int ) (currRuntime.freeMemory() / 1024 / 1024);
           int nTotalMemory = ( int ) (currRuntime.totalMemory() / 1024 / 1024);
           return nFreeMemory + "M/" + nTotalMemory +"M(free/total)" ;
        }
}  
